package alvarodelrosal.chat.client.chataction.remote;

import alvarodelrosal.chat.client.modelo.Connection;
import java.util.ArrayList;
import java.util.List;

public class ChatNewUser implements ChatRemoteAction {

    @Override
    public String getName() {
        return "NewUser";
    }

    @Override
    public void doAction(List<String> parameters) {
        String query = "NewUser<:@:>" + parameters.get(0) + "<:@:>"
                + parameters.get(1) + "<:@:>" + parameters.get(2) + "<:@:>"
                + parameters.get(3) + "<:@:>" + parameters.get(4) + "<:@:>"
                + parameters.get(5);
        
        Connection.sendToServer(query);
    }

    public List<String> generateParameters(String username, String password,
            String confirmation, String name, String mail) {
        List<String> parameters = new ArrayList();
        parameters.add(username);
        parameters.add(password);
        parameters.add(confirmation);
        parameters.add(name);
        parameters.add(mail);
        parameters.add("false");
        
        return parameters;
    }
    
}
